﻿using System;
using System.Threading;
using System.Collections.Generic;
using K4os.Compression.LZ4;
using LiteNetLib;
using LiteNetLib.Utils;

namespace PvpServer
{
    internal class Program
    {
        private const string ListenUri = "http://+:9999/";
        private const string RoomUri = "192.168.11.130";

        public static void Main(string[] args)
        {
	        ///LZ4Codec.Enforce32 = true;
			RoomService roomService = new RoomService();
			roomService.StartService(RoomUri);

            var matchService = new MatchService();
            matchService.StartService(ListenUri);
            
            // 保持主线程运行，直到用户按下回车键
            Console.WriteLine("服务器正在运行中。按下回车键停止服务器...");
            Console.ReadLine();
            
            // 停止服务
            matchService.StopService();
			roomService.StopService();
			
			Thread.Sleep(2000);
        }
    }
}